var baseUrl = "http://47.108.197.28:3000"
function http({
    url
}) {
    return new Promise((resolve, reject)=> {
        wx.request({
            url: baseUrl+url,
            header: {'content-type':'application/json'},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: (res)=>{
                resolve(res)
            },
            fail: (err) => {
                reject(err)
            },
        });
    })
}
function getPlaylistHttp() {
    return http({ url:"/top/playlist/highquality"})
}
function getNewestHttp() {
    return http({ url:"/album/newest"})
}
function getDjprogramHttp() {
    return http({ url:"/personalized/djprogram"})
}
function getDetailHttp() {
    return http({ url:"/top/playlist/id?=${id}"})
}
function getIdHttp() {
    return http({ url:"/playlist/detail?id=2742372871"})
}
module.exports = {
    getDjprogramHttp,
    getNewestHttp,
    getPlaylistHttp,
    getDetailHttp,
    getIdHttp
}